import { defineConfig } from 'windicss/helpers';
import plugin from 'windicss/plugin';
function range(size, startAt = 1) {
	return Array.from(Array(size).keys()).map((i) => i + startAt);
}
export default defineConfig({
	darkMode: 'class', //使用class 不使用自定义属性
	preflight: false, //禁用样式重置
	safelist: [range(100).map((i) => `gap-${i}`), range(100).map((i) => `mb-${i}`)],
	//扩展
	theme: {
		extend: {
			backgroundColor: {
				purple: '#6373ee',
				red: '#F14A46',
			},
			colors: {
				51: 'rgba(51,51,51,.5)',
				danger: '#FF243B',
			},
		},
	},
	shortcuts: {
		'page-container': 'pt-[16px] pl-[16px]',
		'table-action': 'flex items-center',
		shadow: {
			'box-shadow': '0px 4px 12px rgba(0,0,0,0.04)',
		},
		'modal-dialog': '!rounded-[6px] mt-[10px]',
		'modal-footer': 'flex justify-center',
		'modal-footer-btn': '!h-[60px] rounded-[4px] !mr-[16px] text-[18px] flex-1',
	},
	//插件
	plugins: [
		plugin(({ addComponents }) => {
			const border = {
				'.border-das': {
					borderStyle: 'dashed',
					borderWidth: '1px',
					borderColor: '#cccccc',
					borderRadius: '10px',
				},
			};
			addComponents(border);
		}),
	],

	//提取
	extract: {
		include: ['src/**/*.{vue,html,jsx,tsx}'],
		exclude: ['node_modules/**/*', '.git/**/*', 'nginx/*', '*.html', 'static/*'],
	},
});
